home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Interplay's Learn to Program Basic (Review Copy)
/
Learn to Program Basic Review Copy (Interplay)(June 23, 1998).ISO
/
pc
/
ltpbasic
/
projects
/
dragon.bas
< prev
next >
Wrap
BASIC Source File
|
1998-04-08
|
657b
|
49 lines
Cls
dragonX = 50
dragonY = 50
dragon = LoadSprite("DrgnSmlR")
SetSprite dragon To 50,50
CycleSprite dragon
Background "SPACE199"
RunGame = 1
While RunGame
If KeyDown("CURUP") Then
dragonY = dragonY - 1
EndIf
If KeyDown("CURRIGHT") Then
SetSprite dragon Flipped
dragonX = dragonX + 1
EndIf
If KeyDown("CURDOWN") Then
dragonY = dragonY + 1
EndIf
If KeyDown("CURLEFT") THEN
SetSprite dragon Normal
dragonX = dragonX - 1
EndIf
If dragonX < 0 Then dragonX = 0
If dragonX > 300 Then dragonX = 300
If dragonY < 0 Then dragonY = 0
If dragonY > 220 Then dragonY = 220
SetSprite dragon To dragonX, dragonY
If KeyDown("Q") THEN
RunGame = 0
EndIf
Wend